package com.kwq.designPattern.construct.facade;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author kangwanqiang
 * @date 2021/2/7
 */
@Data
public class CarFacade {

    private Car evCar;
    private Car motorCar;

    public CarFacade() {
        evCar = new EVCar();
        motorCar = new MotorCar();
    }

    /**
     * 电动车行驶。代替原有的car中的drive，直接在门面类中调用drive
     */
    public void evCarDrive() {
        evCar.drive();
    }

    /**
     * 燃油车行驶
     */
    public void motorCarDrive() {
        motorCar.drive();
    }
}
